import request from '@/utils/request'

export function login(data) {
  return request({
    url: 'admin/login',
    method: 'post',
    data,
    params: data
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/user',
    method: 'get',
    params: { token }
  })
}

export function logout() {

}

export function getList(params) {
  return request({
    url: '/vue-admin-template/user/getList',
    method: 'get',
    params
  })
}

export function deleteUser(data) {
  return request({
    url: '/vue-admin-template/user/deleteUser',
    method: 'post',
    data
  })
}

export function create(data) {
  return request({
    url: '/vue-admin-template/user/create',
    method: 'post',
    data
  })
}

export function getRoles(data) {
  return request({
    url: '/vue-admin-template/roles/getList',
    method: 'get',
    params: data
  })
}

export function createRoles(data) {
  return request({
    url: '/vue-admin-template/roles/create',
    method: 'post',
    data: data
  })
}

export function deleteRoles(data) {
  return request({
    url: '/vue-admin-template/roles/delete',
    method: 'post',
    data: data
  })
}
